<?php
$articles = $this->articles;
$recommendArticleIds = array();
foreach($articles as $article){
    if($article->getIsRecommend()){
        $recommendArticleIds[] = $article->getId();
    }
}
?>
<dl>
    <dt>
    <?php
    if (!empty($recommendArticleIds)):
        $endIndex = count($recommendArticleIds)-1;
        $recommendArticle = $articles->getItemById($recommendArticleIds[$endIndex]);
        $articles->removeItemById($recommendArticleIds[$endIndex]);
    ?>
        <span><a href="<?php echo $this->getUrl(array('id' => $recommendArticle->getId()), 'detail', 'content', 'article') ?>"> <img src="<?php echo $recommendArticle->getFirstPicture() ?>" width="219" height="274" /></a> </span>
        <label><a href="<?php echo $this->getUrl(array('id' => $recommendArticle->getId()), 'detail', 'content', 'article') ?>"><?php echo $recommendArticle->getTitle() ?></a></label>
        <?php else: ?>
            <span><a href="<?php echo $this->getUrl(array('id' => $articles[0]->getId()), 'detail', 'content', 'article') ?>"> <img src="<?php echo $articles[0]->getFirstPicture() ?>" width="219" height="274" /></a> </span>
            <label><a href="<?php echo $this->getUrl(array('id' => $articles[0]->getId()), 'detail', 'content', 'article') ?>"><?php echo $articles[0]->getTitle() ?></a></label>
        <?php $articles->removeItemById($articles['0']->getId());?>
            
        <?php endif ?>
        </dt>
    <?php
            $i = 0;
            foreach ($articles as $article):
    ?>
                <dd>·<a href="<?php echo $this->getUrl(array('id' => $article->getId()), 'detail', 'content', 'article') ?>"><?php echo $article->getTitle() ?></a></dd>
    <?php
            endforeach;
    ?>
</dl>